#include <stdio.h>
#include <math.h>
#include <stdbool.h>

int main(void){
	unsigned n,sq,result_count,prime_count;
	scanf("%u",&n);
	double prime=3;
	double last_prime=2;
	_Bool is_prime;
	result_count=0;
	prime_count=1;
	while( (unsigned)(prime) <= n ){
		sq=sqrt(prime);
		is_prime=true;
		for(int i=2;i<=sq;i++){
			if( (unsigned)(prime)%i == 0 ){
				is_prime=false;
				break;
			}
		}
		if(is_prime){
//printf("%u ",(unsigned)prime);
			if( 2 == prime-last_prime )
				result_count++;
			last_prime=prime;
			prime_count++;
		}
		prime+=2;
	}
//printf("%u %u",prime_count,result_count);
	printf("%u",result_count);
	return 0;
}
